﻿@model IEnumerable<Scrumrun.Models.UserProfile>

@{
    ViewBag.Title = "UserManage";
}

<h2>Manage Users</h2>

<div class="row mainwrapper">
    <div class="span2">


    </div>

    <div class="span10">
        <div class="contentwrap">

            <table class="srtable">
                <tr>
                    <th>
                        @Html.DisplayNameFor(model => model.UserName)
                    </th>
                    <th>
                        @Html.DisplayNameFor(model => model.isApproved)
                    </th>
                    <th></th>
                </tr>

                @foreach (var item in Model)
                {
                    <tr>
                        <td>
                            @Html.DisplayFor(modelItem => item.UserName)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.isApproved)
                        </td>
                        <td>
                            @if (item.isApproved)
                            {
                                @Html.ActionLink("Lock", "ApproveUser", new { UserName = item.UserName, Approve = false })
                            }else{
                                @Html.ActionLink("Approve", "ApproveUser", new { UserName = item.UserName, Approve = true })            
                            }
                            |
                            @Html.ActionLink("Delete", "DeleteUser", new { UserName = item.UserName })

                        </td>
                    </tr>
                }

            </table>
        </div>
    </div>
</div>